<%@ page import="cn.yunhe.demo.dao.IEmpDao" %>
<%@ page import="cn.yunhe.demo.dao.Empdao" %>
<%@ page import="java.util.List" %>
<%@ page import="cn.yunhe.demo.entity.Emp" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/30
  Time: 14:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<style type="text/css">
    table{
        font-size: 20px;
    }
    table td{
        text-align: center;
        width: 120px;
        height: 30px;
        color: blueviolet;
    }
    table th{
        height: 30px;
        color: orangered;
    }
</style>
<script src="js/jquery-1.8.3.js" type="text/javascript"></script>
<body>
<table border="1" cellpadding="0" cellspacing="0" align="center">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>职位</th>
        <th>薪水</th>
    </tr>

    <%
        IEmpDao empDao = new Empdao();
        List<Emp> list = empDao.allEmp();
        for (Emp emp : list) {
    %>
    <tr>
        <td>
            <%=emp.getId()%>
        </td>
        <td>
            <%=emp.getName()%>
        </td>
        <td>
            <%=emp.getJob()%>
        </td>
        <td>
            <%=emp.getSal()%>
        </td>

    </tr>

    <%
        }
    %>

</table>
</body>
<script>
    $(function(){
        $("tr:even").css("background","lightblue");
    })
</script>
</html>
